package com.techsoul.module.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.techsoul.module.order.pojo.entity.PurchaseOrder;
import com.techsoul.module.order.pojo.param.PurchaseOrderSearchParam;
import com.techsoul.module.order.pojo.vo.PurchaseOrderVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 采购订单Mapper接口
 * 
 * @author liuen
 * @date 2022-08-10
 */
public interface PurchaseOrderMapper extends BaseMapper<PurchaseOrder> {

    /**
     * 详情
     * @param id
     * @return
     */
    PurchaseOrderVo findById(String id);
    BigDecimal findBySum(@Param("purchaseOrderNo") String purchaseOrderNo);
    /**
     * 列表
     * @param params
     * @return
     */
    List<PurchaseOrderVo> findAll(@Param("params") PurchaseOrderSearchParam params);
    PurchaseOrderVo findByPurchaseOrderNo(@Param("purchaseOrderNo") String purchaseOrderNo);
    PurchaseOrderVo findBySourceOrderIdAndIsValid(@Param("sourceOrderId") String sourceOrderId);
    /**
     * 分页
     * @param page
     * @param params
     * @return
     */
    IPage<PurchaseOrderVo> findAll(Page page, @Param("params") PurchaseOrderSearchParam params);

    PurchaseOrderVo findbySapDeliveryNo(@Param("SapOrderNo") String SapOrderNo);
}
